<?php


sleep(2);

$out = array();
if(isset($_POST['data'])){
	$data = json_decode(stripslashes($_POST['data']),1);

	if($data['action'] == 'add'){
		$out['status'] = 1;
		$out['data'] = array(array('id'=>(9+rand(1,10))));
	}else if($data['action'] == 'delete'){
		$out['status'] = 1;
		$out['data'] = array(array('id'=>5,'status'=>1),array('id'=>1,'status'=>1)); 		
	}else if($data['action'] == 'update'){
		$out['status'] = 1;
		$out['data'] = array(array(
							'id'=>5,
							'birthDate'=>"9999-99-92",
							'name'=>"Maria Juana",
							"gender" =>'m',
							'telephone' =>"XxX99826542",
							"show"=>true,
							"editable"=>true),array(
												'id'=>1,
												'birthDate'=>"9999-99-92",
												'name'=>"Maria Juana",
												"gender" =>'f',
												'telephone' =>"XxX99826542",
												"show"=>true,
												"editable"=>true),array(
																	'id'=>10,
																	'birthDate'=>"9999-99-92",
																	'name'=>"Maria Juana",
																	"gender" =>'m',
																	'telephone' =>"XxX99826542",
																	"show"=>true,
																	"editable"=>true)); 		
	}else{
		$out['status'] = 0;
	}
}
echo json_encode($out);
die();


/*
echo '---';
if(isset($_POST['data'])){
		echo print_r($_POST,1);
		

	
	
}else{
	echo print_r($_POST,1);
}
echo '---';
?>
*/